Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defeat merge #141

Open
wants to merge 17 commits into
base: Defeat_Rework
Choose a base branch
from
Open

Defeat merge #141

wants to merge 17 commits into from

Conversation

notlexander
Copy link

It's defeat but mostly better because of new transform code and being reworked on the back end.
While enabled in the customizer, you'll turn into a sexnode when defeated and the closest compatible enemy will join it.
While enabled in the customizer (separately), supported npcs/monsters you deal lethal damage to will turn into a sexnode for a period of time.
It even does those things consistently now!

Change overview:
-fixed defeat node interactibility allowing escape when it's not intended
-a custom regen buff to get rid of the regen particles
-a config option to allow players to bail from a defeat node
-fixed ui alignment when players are defeated (players are teleported to defeat location)
-solved the protected tile problem (for defeated players in protected areas, NPCs and monsters instead place the sexnode)
-solved the DoT problem - on lethal damage, defeat grabs any nearby valid entity that has targeted the player instead of relying on damage source.
-added on/off switches in the customizer for defeat participation
-added a momentary invincibility buff after defeat so you don't get auto smacked. (1.5 seconds)
-disabled normal dialog on defeat nodes
-added code to bail out of the defeat process when no valid positions exist (really just for terato FxF)
-ensured transform functionality remains for other mods that use transform code (tested EB's whips, should be)

Possible issues
-because node interactibility turns of when a second actor joins a defeat node, players cannot join 3+ entity defeat nodes
-players defeated by players can still interact with their own node to leave it before the other player joins

ErinaSugino and others added 16 commits June 26, 2024 00:29
Rework of the Lustia dungeon, attempting to integrate addon content more naturally.
This version tries to add a closed, run-down version of the arcade from the Omnibrowser addon, with a clearer hint at to where and how to get the content.
Currently doesn't work, hard-crashes randomly and doesn't properly generate otherwise.
>enabled defeated status detection for sexbound
    >disables UI based on config setting
    >enables NPC auto position and auto climax against defeated players
    >increased climax speed on defeat nodes

>updated transform code
    >scans a wider area (default was a single block)
    >removed "occupied" detection as it was redundant and innaccurate
Wrong config reference made kid stage always be skipped.
Permanently added the arcade of the `Lustbound Omnibrowser Addon` into the Lustia instanceworld, in a naturally closed/derelict state.
Added a natural status effect to Lustia which increases the rate of arousal gain for all entities.
Added a stat and code to allow status effects to cumulatively influence the rate of arousal gain via multipliers.
Cleanup development pipeline by syncing all my local discrepancies to the repo.
Made the birthcontrol pill actually functioning.
Made the birthing pill more failsave with blocking status conditions.
Added debug versions of the birthing and hyper fertility pill, which will retain old functionality and are only obtainble via commands.
Added placeholders for penalties applied by the normal birthing pill and hyper fertility pill. (Missing content)
Added placeholder for speed birth pill, a less OP and penalty-free version of the birthing pill (like the normal fertility pill). (Missing content)
>Defeat nodes are no longer interactable when a second actor joins
    >players defeated by other players maybe still can interact before
    their attacker joins
>Transform code further stabilized and updated to move players to
the placed node.
>New config option allowing players to bail from defeat nodes with ESC.
>Custom regen buff added to remove regen particles during defeat scene.
>NPCs and Monsters that defeat the player now handle node placement to
allow tile protection to be turned off/on in protected areas.
>Defeat no longer relies on damage source entity
    >Instead checks for nearest tracked hostile
    >Fixes death by DoT or other means
>Fixed transform bug from last commit
-moved message sending for the defeat entity tracker to behaviors instead of overriding or hooking notification.lua
-added on/off switches for defeat functionality using customizer
-momentary invincibility buff after defeat so you don't get auto smacked. (1.5 seconds)
-disabled normal dialog on defeat nodes
-added code to bail out of defeat sexnodes when no valid positions exist
-ensured old transform functionality remains for other mods that use transform code (tested EB's whips, works fine)
@@ -95,6 +95,10 @@ end

--- Function to choose a random available
function Sexbound.Sextalk:triggerTalk()

-- disable dialog if its a defeat node (will have separate dialog in the future)
if self._parent._containsDefeated then return end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly a workaround hack, so please ensure to properly mark down that this needs changing in the future.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mentioned a process that was something along the lines of duplicating the existing positions and making "defeat" versions with their own dialog. I haven't actually looked into the code to find where I'd have to make changes to do that yet but it seemed too complicated for my fried brain so I just added this for now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the main node objects themselves, the available positions are defined.

"sexboundConfig" : {
    "animationPartsCentered": false,
    "position" : {
      "sex" : [ "standing", "doggy", "missionary", "cowgirl", "facesitting", "butterfly", "fellatio", "reverse_cowgirl" ]
    }
  }

You'd change these to different one. I'd just rename them all to "*_defeat". These new positions also need to be defined in /positions/positions.config. That file maps the name to the actual file path. Then just add the new positions.

In the new position configs, you would mostly just define "base" : "<base position name>" to have ALL of the base position's data, then just overwrite the "dialog": {} table to link to new defeat specific dialog files for each race.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty straightforward. I'll add in that functionality. Writing the actual dialog however isn't as much in my wheelhouse so I'd leave those free to be filled in if that's alright.

-- Open UI if not defeated or is allowed to while defeated.
if not actor:getStatus():hasStatus("sexbound_defeated") then
actor:openUI()
self._playerControl = true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears you are missing the part where you actually set self._containsDefeated, which is used a couple lines further down.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets set later lines 380-382. The checks on 358 and 372 are for when an actor joins a node that already contains a defeated actor.

Copy link
Owner

@ErinaSugino ErinaSugino Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you are doing it this way to lock the node up once a second actor joins, assuming the defeated one is the first?

You also mentioned in the potential issues that this potentially disallows 3 actors and causes PVP problems with the defeated player interacting with their own node in time. There is a better solution to this problem. I don't know if there is a way to, via status effect, turn of a players ability to interact as a whole, but even if not you'd just need to edit the "onInteraction" function on the main node itself. The node upon creation gets the entity ID of the OG "defeated" target and, in the "onInteraction" function, if the interacting entity is that ID just null their lounge request. The "onInteraction" method is supposed to return nil or the name of an interaction type - the entity only lounges if the response is nil (and it's a loungable) or specifically the lounge operation. You can look up in the StarGlue repo what the allowed types are, or I can check it in a bit, cause I have done something similar for the Neki race mode whereas non-Nekis cannot lounge in a specific object.

EDIT: Looked up the nulling of the lounge request. It's:
return {"Message", {messageType = "noop", messageArgs = {}}}
(Where "noop" is just the name of ANY type of entity Message that has NO handler attached to it, otherwise it would call the message handler.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did look into nullifying specific lounge requests using "onInteraction" but had no luck with my attempts. I think I had it returning nil expecting it to just skip the lounge handling but that makes sense. Am I right that what you're saying is that I could just have it do the entity ID check and have it return that exact message that you wrote?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. You just need to somehow transmit the source entity's ID on transformation, so the node inherently knows...
...actually, no you don't. You just block requests of the entity IDs of every actor that is already in there. The data is all there once the "lounging" is successful. Though that would still leave room for accidents with conveniently interacting the tick the node is spawned, so maybe still transmit the source entity's ID in the transformation itself, and lock that one out.

Returning the above will nullify the lounge request, because the interaction actually tries to trigger a message handler that should not exist, and hence does nothing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems clear to me! I'll work on that change.

@@ -130,6 +130,10 @@ function Sexbound.Actor.Climax:onUpdateSexState(dt)

local multiplier = actor:getPosition():getAnimationState("sexState"):getClimaxMultiplier(actorNumber) or 1
local increase = util.randomInRange(self:getDefaultIncrease()) * multiplier * dt
-- increase point gain if this is a defeat node to allow for climaxing during the limited sexnode duration
if self:getParent():getParent():getContainsDefeated() then
increase = increase * 2.1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should potentially be made a config option, to be changed alongside how long the node stays.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, I'll look into implementing that.

if self:isPlayer() then
-- Check config for using invisible "UI" that allows escape with ESC key
if self._config.enableDefeatedPlayerEscape then world.sendEntityMessage(self._entityId, "Sexbound:UI:Show", {config = self:loadUIConfig()}) end
status.addEphemeralEffect("dontstarve", self._timeout)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the starve protection from all sexnodes so far, so for consistency this needs to go aswell.

HOWEVER, this brought up another question. What happens if you die inside of a sexnode? E.g. starve to death mid sex. How does defeat handle this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can still take damage while in sexnodes, since being defeated is the only thing that prevents damage at the moment. If you die, something weird happens and not only are you killed, but then you also die. Which is a funny way to say you die twice.

Anyway I can remove that.

-removed starve prevention status for players during transform success
-renamed the status for enabling ui when defeated for consistency
-removed update loop prevention during defeat status and tested, appears to work fine
-merged player_primary.lua, npc_primary.lua, and monster_primary.lua to their respective main paths
-fixed "floating" bug when sexnodes are destroyed by removing the new stun status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants